package io.renren.modules.job.task;

import io.renren.modules.book.mq.RabbitConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

@Component
public class MqTask {
    @Autowired
    RabbitTemplate rabbitTemplate;
    private Logger logger = LoggerFactory.getLogger(getClass());

   // @Scheduled(cron = "0/5 * * * * ? ")
 /*   public void sendHuang(){
        System.out.println("11111111111111111111");
       // logger.info("mqTask定时任务正在执行，参数为：{}", );
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String message = "这一秒你只属于我-----"+now.format(formatter);
        rabbitTemplate.convertAndSend(RabbitConfig.EXCHANGE_DIRECT_HUANG, RabbitConfig.ROUTINGKEY_DIRECT_HUANG, message);
    }*/
}
